<template>
  <view class="env-info" v-if="showEnvInfo">
    <text class="env-text">{{ envText }}</text>
  </view>
</template>

<script>
import { config, currentEnv, isDevelopment, isTest } from '@/config/env'

export default {
  name: 'EnvInfo',
  data() {
    return {
      envText: `${config.name} | ${config.apiBaseUrl}`,
      showEnvInfo: isDevelopment() || isTest()  // 只在开发和测试环境显示
    }
  }
}
</script>

<style scoped>
.env-info {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background-color: #ff6b6b;
  padding: 2px 8px;
  text-align: center;
}

.env-text {
  color: white;
  font-size: 12px;
  line-height: 20px;
}
</style> 